{{ 'component-image-with-text.css' | asset_url | stylesheet_tag }}
<div class="video-with-text">
    <div class="image-text-news">
        <div class="image-with-text {% if section.settings.full_width %}image-with-text--full-width{% else %}page-width{% endif %} color-scheme-{{ section.settings.color_scheme }}">
            <div class="image-with-text__grid color-{{ section.settings.color_scheme }}{% if section.settings.layout == 'text_first' %} image-with-text__grid--reverse{% endif %} grid grid--gapless grid--1-col grid--2-col-tablet">
              <div class="grid__item">
                <div class="image-with-text__media image-with-text__media--{{ section.settings.height }} {% if section.settings.image != blank %}media{% else %}image-with-text__media--placeholder placeholder{% endif %}">
                    <div class="video-text">
                      <div class="video-overlay">

                       <video loading="lazy" class="videos video lazy" x5-video-player-type="h5" autoplay muted loop playsinline poster="https://cdn.shopify.com/s/files/1/0563/3926/7733/files/v_bg.webp?v=1637723314">
                        <source x5-video-player-type="h5" data-src="https://cdn.shopify.com/s/files/1/0563/3926/7733/files/output_compress-video-online.com.mp4?v=1643170193" type="video/webm" >
                        <source x5-video-player-type="h5" data-src="https://cdn.shopify.com/s/files/1/0563/3926/7733/files/output_compress-video-online.com.mp4?v=1643170193" type="video/mp4" >
                      </video>


                      </div>
                  </div>
                </div>
              </div>
              <div class="grid__item">
                <div class="image-with-text__content image-with-text__content--{{ section.settings.height }}" data-wow-delay=".2s">
                  {%- for block in section.blocks -%}
                    {% case block.type %}
                      {%- when 'heading' -%}
                        <h2 class="image-with-text__heading h1" {{ block.shopify_attributes }}>
                          <div class="video_title">
                            {{ block.settings.richtext }}
                          </div>
                        </h2>
                      {%- when 'text' -%}
                        <div class="image-with-text__text rte" data-wow-delay=".23" {{ block.shopify_attributes }}>{{ block.settings.text }}</div>
                      {%- when 'button' -%}
                      {%- if block.settings.button_label != blank -%}
                      <button class="button  m-cta " id="{{ block.settings.popup }}">
                        <span>{{ block.settings.button_label | escape }}</span>
                      </button>
                    {%- endif-%}
                    {%- endcase -%}
                  {%- endfor -%}
                </div>
              </div>
            </div>
          </div>
    </div>
</div>

{% schema %}
{
  "name": "Video with text",
  "class": "spaced-section spaced-section--full-width",
  "settings": [
    {
      "type": "image_picker",
      "id": "image",
      "label": "t:sections.image-with-text.settings.image.label"
    },
    {
      "type": "select",
      "id": "height",
      "options": [
        {
          "value": "adapt",
          "label": "t:sections.image-with-text.settings.height.options__1.label"
        },
        {
          "value": "small",
          "label": "t:sections.image-with-text.settings.height.options__2.label"
        },
        {
          "value": "large",
          "label": "t:sections.image-with-text.settings.height.options__3.label"
        }
      ],
      "default": "adapt",
      "label": "t:sections.image-with-text.settings.height.label"
    },
    {
      "type": "select",
      "id": "color_scheme",
      "options": [
        {
          "value": "background-1",
          "label": "t:sections.image-with-text.settings.color_scheme.options__1.label"
        },
        {
          "value": "background-2",
          "label": "t:sections.image-with-text.settings.color_scheme.options__2.label"
        },
        {
          "value": "inverse",
          "label": "t:sections.image-with-text.settings.color_scheme.options__3.label"
        },
        {
          "value": "accent-1",
          "label": "t:sections.image-with-text.settings.color_scheme.options__4.label"
        },
        {
          "value": "accent-2",
          "label": "t:sections.image-with-text.settings.color_scheme.options__5.label"
        }
      ],
      "default": "background-1",
      "label": "t:sections.image-with-text.settings.color_scheme.label"
    },
    {
      "type": "select",
      "id": "layout",
      "options": [
        {
          "value": "image_first",
          "label": "t:sections.image-with-text.settings.layout.options__1.label"
        },
        {
          "value": "text_first",
          "label": "t:sections.image-with-text.settings.layout.options__2.label"
        }
      ],
      "default": "image_first",
      "label": "t:sections.image-with-text.settings.layout.label",
      "info": "t:sections.image-with-text.settings.layout.info"
    }
  ],
  "blocks": [
    {
      "type": "heading",
      "name": "t:sections.image-with-text.blocks.heading.name",
      "limit": 1,
      "settings": [
      {
        "type": "richtext",
        "id": "richtext",
        "default": "<p>richtext</p>",
        "label": "Title"
      }
      ]
    },
    {
      "type": "text",
      "name": "t:sections.image-with-text.blocks.text.name",
      "limit": 1,
      "settings": [
        {
          "type": "richtext",
          "id": "text",
          "default": "<p>Pair text with an image to focus on your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.</p>",
          "label": "t:sections.image-with-text.blocks.text.settings.text.label"
        }
      ]
    },
    {
      "type": "button",
      "name": "t:sections.image-with-text.blocks.button.name",
      "limit": 1,
      "settings": [
        {
          "type": "text",
          "id": "button_label",
          "default": "Button label",
          "label": "t:sections.image-with-text.blocks.button.settings.button_label.label",
          "info": "t:sections.image-with-text.blocks.button.settings.button_label.info"
        },
        {
          "type": "text",
          "id": "popup",
          "label": "popup"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Video with text",
      "blocks": [
        {
          "type": "heading"
        },
        {
          "type": "text"
        },
        {
          "type": "button"
        }
      ]
    }
  ]
}
{% endschema %}
